I am trying to use a dictionary include file that I have created in order to display a GUI using a selected language. The Language has been set in the registry as either french or english. |
Re: DialogBoxes using INC files It seems that it is not possible to show a dialogBox that has methods that return stringhttp://] arrays. Maybe it is not possible to stack more than 1 array from any given method call. In order to get around this I will grab the values in the dictionary and then populate my string array[ in the same method that created the original DB. DB db = create "dialog" Skip dictionary_values_skip = createString() int count = populate_and_count(dictionary_values_skip, TOOL_TYPE, RADIO_BUTTON) string combo_definition_radiocount fill_array_with_radio_items(dictionary_values_skip, combo_definition_radio) dbe_baseline_type_radiobutton = radioBox(db, "", combo_definition_radio, 0) However, I would have prefered to encapsulate everything in a helper function. DXL has decided otherwise. |
Re: DialogBoxes using INC files PatrickGuay - Thu Dec 15 14:44:32 EST 2011 https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14472558#14472558 https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14472624� There is some lengthy reading about dealing with arrays in DXL but the main cause of your problems is the nature of arrays. When you declare a one dimensional array inside a function, then this array will live inside the function, afterwards it will be flagged for destruction. Unfortunately radioBox and checkBox will not make a copy of your array, but just keep a reference to it. The array must be alive until you call realize or show. If you do it like in your code, you will pass the array to radiobox inside a function but after the function ends the array will not be alive anymore. So what can you do? Well the approach you choose is one way to handle this. You can still keep a function, but you need to move the array declaration somewhere on the global level to make sure its lifetime will be long enough until realize/show. However I would suggest you take a look in the native DOORS multi language facilities (provided you use DOORS 9.1+). See for example this post: https://www.ibm.com/developerworks/forums/click.jspa?searchID=-1&messageID=14578658 Maybe that helps, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |